import { Component, Inject, Signal } from '@angular/core';
import { Info, AbsInfoService } from '../interface';
import { JsonPipe } from '@angular/common';

@Component({
  selector: 'app-demo3',
  standalone: true,
  imports: [JsonPipe],
  templateUrl: './demo3.component.html',
  styleUrl: './demo3.component.css',
})
export class Demo3Component {
  successMessages: Signal<Info[]>;
  errorMessages: Signal<Info[]>;

  constructor(@Inject(AbsInfoService) allInfoServices: AbsInfoService[]) {
    this.successMessages = allInfoServices[0].all;
    this.errorMessages = allInfoServices[1].all;
  }
}
